/**
 * Radio Story Cards - using RFID tags to track physical story cards in an agile/lean environment.
 *
 * See http://www.radiostorycards.com for more information.
 *
 *
 * Copyright (C) 2011, Ted M. Young
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
package com.radiostorycards;

import com.radiostorycards.datetime.DateTimeProvider;
import org.joda.time.DateTime;
import org.joda.time.Duration;

/**
 * @author Ted Young <tedyoung@gmail.com> @JitterTed
 */
public class IncrementDateTimeProvider implements DateTimeProvider {
  private DateTime _currentDateTime;
  private Duration _duration;

  public IncrementDateTimeProvider(DateTime dateTime, Duration amountToIncrementEachRequest) {
    _currentDateTime = dateTime;
    _duration = amountToIncrementEachRequest;
  }

  @Override
  public DateTime currentDateTime() {
    DateTime now = _currentDateTime;
    _currentDateTime = _currentDateTime.plus(_duration);
    return now;
  }
}
